﻿<Window x:Class="VisualMetal.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
    Title="Visual Metal"
    MinWidth="980"
    MinHeight="700"
	>
	<DockPanel>
		<Menu DockPanel.Dock="Top">
			<MenuItem Header="_File" >
				<MenuItem Header="_Login to Database..." Click="Login_Click" />
				<MenuItem Header="_Open DBML..." Click="Open_Click" />
				<MenuItem Header="_Save DBML..." Click="SaveDbml_Click" />
				<Separator />
				<MenuItem Header="_Generate C#..." Click="GenerateCSharp_Click" />
				<MenuItem Header="Generate _Visual Basic..." Click="GenerateVisualBasic_Click" />
				<Separator />
				<MenuItem Header="E_xit" Click="Exit_Click" />
			</MenuItem>
		</Menu>
		<Grid>
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="Auto" />
				<ColumnDefinition />
				<ColumnDefinition />
			</Grid.ColumnDefinitions>

			<StackPanel Grid.Column="0" >
				<GroupBox Header="Database">
					<WindowsFormsHost Width="220" Height="500" >
						<wf:PropertyGrid x:Name="SchemaPropertyGrid" />
					</WindowsFormsHost>
				</GroupBox>			
			</StackPanel>
			
			<GroupBox Header="Tables" Grid.Column="1">
				<Grid>
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="*" />
						<ColumnDefinition Width="225" />
					</Grid.ColumnDefinitions>
					<Grid.RowDefinitions>
						<RowDefinition />
						<RowDefinition Height="Auto" />
					</Grid.RowDefinitions>

					<ListBox Grid.Row="0" x:Name="TableList" SelectionChanged="TableList_SelectionChanged" />

					<Button Grid.Row="1" Click="RebindTableList" Margin="5" >Refresh Table View</Button>

					<WindowsFormsHost Width="220" Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" >
						<wf:PropertyGrid x:Name="TablePropertyGrid" />
					</WindowsFormsHost>
				</Grid>
			</GroupBox>
			
			<GroupBox Header="Columns / Associations" Grid.Column="2">
				<Grid>
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="*" />
						<ColumnDefinition Width="225" />
					</Grid.ColumnDefinitions>
					<Grid.RowDefinitions>
						<RowDefinition />
						<RowDefinition Height="Auto" />
					</Grid.RowDefinitions>

					<ListBox Grid.Row="0" x:Name="ColumnList" SelectionChanged="ColumnList_SelectionChanged" />

					<Button Grid.Row="1" Click="RebindColumnList" Margin="5" >Refresh Column View</Button>

					<WindowsFormsHost Width="220" Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" >
						<wf:PropertyGrid x:Name="ColumnPropertyGrid" />
					</WindowsFormsHost>
				</Grid>
			</GroupBox>
		</Grid>
	</DockPanel>
</Window>
